package net.aiion.weave.spi.messaging.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This annotation may be used on methods in a {@link net.aiion.weave.spi.naming.annotations.Named} class to receive messages via a
 * {@link net.aiion.weave.spi.messaging.MessageQueue}. The <tt>value</tt> of the annotation specifies the queue's
 * name, from which messages may be received. A {@link Receives} annotated method must accept exactly one parameter of
 * the type of the message to be received. Optionally the annotated method may return a value of any type. This value
 * may be examined in a {@link net.aiion.weave.spi.messaging.MessageCallback} given as an argument while sending the
 * received message.
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Receives
{
    /**
     * The <tt>value</tt> specifies the queue's name, from which messages may be received.
     */
    String value();
}
